﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UniUI.ConsoleUI
{
    public class ConsoleWindow
    {
        public ConsoleContainerCtrl MainControl { get; set; }

        public ConsoleWindow(int left, int top, int width, int height, ConsoleColor color = ConsoleColor.Black)
        {
            this.MainControl = new ConsoleContainerCtrl(null)
            {
                Left = left,
                Top = top,
                Width = width,
                Height = height,
                BackgroundColor = color,
            };
            MainControl.GetFocus();
        }

        public static ConsoleWindow Create()
        {
            return new ConsoleWindow(0, 0, Console.WindowWidth, Console.WindowHeight - 1, ConsoleColor.Black);
        }

        public void Invalidate(int left, int top, int width, int height)
        {
            MainControl.Invalidate(left, top, width, height);
        }
    }
}
